///支付信息Model类  1.新用户促销  2.活动促销  3金币商店支付   公用此实体类，统一传参使用
class CnPlayGoodModel {
  double? localPaymentPriceRupee = 0.00; //印度价格
  String? activityName = ""; //活动名称
  String? activityPic = ""; // 活动图片地址
  String? activitySmallPic = ""; //活动小图地址
  int? capableRechargeNum = 0; //能充值数量
  String? code = "";
  double? discount = 0.00; //折扣
  int? exchangeCoin = 0; //兑换金币数
  int? extraCoin = 0; //额外的金币数量
  int? rechargeNum = 0; //充值次数
  int? extraCoinPercent = 0; //额外的金币比例
  String? goodsId = ""; //商品id
  String? icon = ""; //商品图标
  bool? isPromotion = false;
  String? originalCode = "";
  double? originalPrice = 0.00; //原价
  double? originalPriceRupee = 0.00; //原价(卢比)
  double? price = 0.00; //当前价格
  double? priceRupee = 0.00; //当前价格(卢比)
  String? surplusMillisecond = "0"; //新用户倒计时剩余毫秒数
  String? remainMilliseconds = "0"; //活动促销倒计时剩余毫秒数
  int? newUserCountdown = 0; //用于显示新用户计算过后的活动倒计时时间
  int? eventPromotionCountdown = 0; //用于显示活动促销计算过后的活动倒计时时间
  String? tags = ""; //商品标签
  int? thirdpartyCoinPercent = 0; //三方充值赠送比例(新活动促销字段)
  String? type = ""; //商品类型
  String? invitationId = ""; //邀请链接id
  int? validity = 0;
  String? validityUnit = "";
  int? localPayOriginalPrice = 0;
  int? localPayPrice = 0;

  CnPlayGoodModel({
    required this.localPaymentPriceRupee,
    required this.activityName,
    required this.activityPic,
    required this.activitySmallPic,
    required this.capableRechargeNum,
    required this.code,
    required this.discount,
    required this.exchangeCoin,
    required this.extraCoin,
    required this.rechargeNum,
    required this.extraCoinPercent,
    required this.goodsId,
    required this.icon,
    required this.isPromotion,
    required this.originalCode,
    required this.originalPrice,
    required this.originalPriceRupee,
    required this.price,
    required this.priceRupee,
    required this.surplusMillisecond,
    required this.remainMilliseconds,
    required this.tags,
    required this.thirdpartyCoinPercent,
    required this.type,
    required this.invitationId,
    required this.validity,
    required this.validityUnit,
    required this.localPayOriginalPrice,
    required this.localPayPrice,
  });

  factory CnPlayGoodModel.coverFromJson(dynamic promotionData) => CnPlayGoodModel(
        localPaymentPriceRupee: promotionData['localPaymentPriceRupee'] ?? 0.0,
        activityName: promotionData['activityName'] ?? "",
        activityPic: promotionData['activityPic'] ?? "",
        activitySmallPic: promotionData['activitySmallPic'] ?? "",
        capableRechargeNum: promotionData['capableRechargeNum'] ?? 0,
        code: promotionData['code'] ?? "",
        discount: promotionData['discount'] ?? 0.0,
        exchangeCoin: promotionData['exchangeCoin'] ?? 0,
        extraCoin: promotionData['extraCoin'] ?? 0,
        rechargeNum: promotionData['rechargeNum'] ?? 0,
        extraCoinPercent: promotionData['extraCoinPercent'] ?? 0,
        goodsId: promotionData['goodsId'] ?? "",
        icon: promotionData['icon'] ?? "",
        isPromotion: promotionData['isPromotion'] ?? false,
        originalCode: promotionData['originalCode'] ?? "",
        originalPrice: promotionData['originalPrice'] ?? 0.0,
        originalPriceRupee: promotionData['originalPriceRupee'] ?? 0.0,
        price: promotionData['price'] ?? 0.0,
        priceRupee: promotionData['priceRupee'] ?? 0.0,
        surplusMillisecond: promotionData['surplusMillisecond'] ?? "0",
        remainMilliseconds: promotionData['remainMilliseconds'] ?? "0",
        tags: promotionData['tags'] ?? "",
        thirdpartyCoinPercent: promotionData['thirdpartyCoinPercent'] ?? 0,
        type: promotionData['type'] ?? "",
        invitationId: promotionData['invitationId'] ?? "",
        validity: promotionData['validity'] ?? 0,
        validityUnit: promotionData['validityUnit'] ?? "",
        localPayOriginalPrice: promotionData['localPayOriginalPrice'] ?? 0,
        localPayPrice: promotionData['localPayPrice'] ?? 0,
      );

  @override
  String toString() {
    return 'CnPlayGoodModel{code: $code, tags: $tags}';
  }
}
